package e

var MsgFlags = map[int]string{
	SUCCESS:                       "ok",
	ERROR:                         "fail",
	InvalidParams:                 "请求参数错误",
	RedisError:                    "操作Redis异常",
	GetLetsEncryptAccountError:    "获取letsencrypt账号信息异常",
	CreateLetsEncryptAccountError: "创建letsencrypt账号信息异常",
	CheckLetsEncryptAccountError:  "检查letsencrypt账号信息异常",
	GetAcmeClientError:            "获取acmeClient异常",
	GetAcmeAccountError:           "获取acmeAccount异常",
	IssueJobError:                 "定时任务触发失败",
	DomainHasAlreadyExisted:       "域名已存在",
	DomainHasNotExisted:           "域名不存在",
	CertificateIssueError:         "证书签发失败",
	ParseNotAfterError:            "解析notAfter失败",
	FlushCertificateError:         "刷新证书文件异常",
	FlushPrivateKeyError:          "刷新私钥文件异常",
}

// GetMsg get error information based on Code
func GetMsg(code int) string {
	msg, ok := MsgFlags[code]
	if ok {
		return msg
	}

	return MsgFlags[ERROR]
}
